#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main()
{
	int m = 0;
	int n = 0;
	int c = 0;
	int conut = 0;
	scanf("%d %d", &m, &n);
	c = m ^ n;
	while(c!=0)
	{
		conut++;
		c = c & (c - 1);
	}
	printf("%d", conut);
	return 0;
}

